package com.xvyy.tingshu.cdc.receiver;


import lombok.extern.slf4j.Slf4j;

/**
 * ClassName: CDCConsumer
 * Package: com.xvyy.tingshu.cdc.receiver
 *
 * @Description:
 * @Author: xvyy
 * @Create: 2025/2/9 - 12:41
 * @Version: v1.0
 */
//@Component
@Slf4j
public class CDCReceiver {

    // TODO 调用rabbitmq 继续消费数据 继续删除redis数据，保证数据一致性
/*    @Autowired
    private MqOpsService mqOpsService;*/


/*    @RabbitListener(bindings = @QueueBinding(
            exchange = @Exchange(name = MqConst.EXCHANGE_CANAL),
            key = MqConst.ROUTING_CANAL_UPDATE,
            value = @Queue(name = MqConst.QUEUE_CANAL_UPDATE, durable = "true")))*/
    /*  @SneakyThrows
    public void deleteCache(String content, Message message, Channel channel) {

      log.info("收到更新消息：{}", content);
        // 1. 获取消息，进行判断
        if (StringUtils.isEmpty(content)) {
            return;
        }

        // 2. 消费消息
        mqOpsService.deleteCache(content);

        long deliveryTag = message.getMessageProperties().getDeliveryTag();
        // 3. 手动确认消息
        channel.basicAck(deliveryTag, false);

    }*/
}
